<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card" data-table-id="MenuTable">

    <div class="layui-card-body">

        <div class="layui-form-item">
            <label class="layui-form-label label-required-next">{:lang('上级分类')}</label>
            <div class="layui-input-block">
                <select name='pid' class='layui-select' lay-search>
                    {foreach $categorys as $category}{eq name='category.id' value='$vo.pid|default=0'}
                    <option selected value='{$category.id}'>{$category.spl|raw}{$category.name}</option>
                    {else}
                    <option value='{$category.id}'>{$category.spl|raw}{$category.name}</option>
                    {/eq}{/foreach}
                </select>
                <p class="help-block"><b>必选</b>，请选择上级分类或顶级分类 ( 目前最多支持三级分类 )</p>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">{:lang('分类名称')}</label>
            <div class="layui-input-block">
                <input name="name" value='{$vo.name|default=""}' required vali-name="分类名称" placeholder="请输入分类名称" class="layui-input">
                <input type="hidden" name="uniacid" value="2">
                <p class="help-block"><b>必选</b>，请填写分类名称 ( 如：系统管理 )，建议字符不要太长，一般 4-6 个汉字</p>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">{:lang('分类状态')}</label>
            <div class="layui-input-block">
                <select name="status">
                    <option value="1" {if isset($vo.status) and $vo.status == 1}selected='selected'{/if}>激活</option>
                    <option value="0" {if isset($vo.status) and $vo.status == 0}selected='selected'{/if}>禁用</option>
                </select>
                
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">{:lang('分类图标')}</label>
            <div class="layui-input-block">
                <div class="layui-textarea help-images">
                    <input type="hidden" value="{$vo.thumb|default=''}" name="thumb">
                </div>
            </div>
        </div>

    </div>

    <div class="hr-line-dashed"></div>
    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}

    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>{:lang('保存数据')}</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="{:lang('确定要取消编辑吗？')}" data-close>{:lang('取消编辑')}</button>
    </div>
</form>

<script>
    $('[name=thumb]').uploadOneImage(); 
</script>